package com.lesson11.waiguan;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/9/2 19:33
 */
public class Home
{
    //定义子系统对象
    private BaoMiHua baoMiHua;
    private DVDPlay dvdPlay;
    private Light light;
    private Screen screen;
    private TouYing touYing;
    private YinXiang yinXiang;

    public Home()
    {
        this.baoMiHua = BaoMiHua.getInstance();
        this.dvdPlay = DVDPlay.getInstance();
        this.light = Light.getInstance();
        this.screen = Screen.getInstance();
        this.touYing = TouYing.getInstance();
        this.yinXiang = YinXiang.getInstance();
    }

    public void ready(){
        baoMiHua.on();
        baoMiHua.pop();
        screen.down();
        touYing.on();
        yinXiang.on();
        dvdPlay.on();
    }

    public void play(){
        dvdPlay.play();
    }

    public void pause(){
        dvdPlay.pause();
    }

    public void end(){
        baoMiHua.off();
        screen.up();
        touYing.off();
        yinXiang.off();
        dvdPlay.off();
    }
}
